<?php 

$auth = $_SESSION['auth'];
if (empty($auth)) die('用户未登录！');

global $config;
if (!in_array($auth['id'], $config['manager'])) die('用户权限不够!');
?>
<div class="finance-nav-sub">
	<div class="container">
		<ul class="nav navbar-nav">
			<li>
			<a href="?c=finance&a=item_manage">项目管理</a>
			</li>
			<li>
			<a href="?c=finance&a=issue_manage">公告管理</a>
			</li>
			<li>
			<a href="?c=finance&a=lmcy_manage">成员管理</a>
			</li>
		</ul>
	</div>
</div>
<div class="container finance-item-add" style="padding-top:15px">
	<div class="row clearfix">
		<div class="col-md-12 column">
			<h3><span class="glyphicon glyphicon-edit"></span> 添加成员</h3>
			<hr class="solid">
			<div class="col-md-12 column">
				<form class="form-horizontal" action="?c=finance&a=do_lmcy_add" method="post">
					<fieldset>
						<!-- select -->
						<div class="form-group">
							<label class="col-md-2 control-label">类型</label>  
							<div class="col-md-7">
								<select name="kind" class="form-control">
									<option value="TZ">投资公司</option>
									<option value="DB">担保公司</option>
								</select>
							</div>
						</div>
						<!-- Text input-->
						<div class="form-group">
							<label class="col-md-2 control-label">名称</label>  
							<div class="col-md-7">
								<input name="name" type="text" placeholder="成员名称" class="form-control input-md" required="">
							</div>
						</div>
						<!-- Text input-->
						<div class="form-group">
							<label class="col-md-2 control-label">用户 ID</label>  
							<div class="col-md-7">
								<input name="user_id" type="text" placeholder="用户 ID" class="form-control input-md" required="">
							</div>
						</div>
						<!-- token -->
						<input type="hidden" name="token" value="<?php echo get_token() ?>"/>

						<!-- Button -->
						<br>
						<div class="form-group">
							<label class="col-md-2 control-label"></label>
							<div class="col-md-2">
								<button onclick="save_input()" class="btn btn-primary btn-block">添加成员</button>
							</div>
						</div>

					</fieldset>
				</form>	


			</div>
		</div>
	</div>
</div>

<script type="text/javascript">

$(document).ready(function(){
		recover_input(); 
		});


function recover_input() {
	$("input").each(function(){
			if ('token' != $(this).attr('name')) {
			$(this).val(getCookie('lmcy_add_'+$(this).attr('name'))); 
			}
			});
}

function save_input() {
	$("input").each(function(){ setCookie('lmcy_add_'+$(this).attr('name'), $(this).val(), 365, '/'); });
}

</script>
